CreateContainer
Document ShellThe
CreateContainer
method creates a container object with the specified container type and identifier.
ODContainer CreateContainer ( in ODContainerType containerType, in ODContainerID id);
containerType
- The type of the container object.
id
- A container ID whose buffer contains data identifying the container object.
- return value
- A reference to the newly created container object.
DISCUSSION
The container type must be one of the following: the default file container for this platform (kODDefaultFileContainer
), the default memory container for this platform (kODDefaultMemoryContainer
), the Bento file container (kODBentoFileContainer
), or the Bento memory container (kODBentoMemoryContainer
).The structure of the data in the
id
parameter's buffer depends on the type of container, as specified by thecontainerType
parameter. For example, the identifier for a file container is a specification for a file-system file; the identifier for a memory container is a handle for a relocatable memory block.The physical container corresponding to the specified container type and container identifier must exist when this method is called.
When the structure passed as the
id
parameter is no longer needed, the caller should deallocate that structure and its buffer.This method initializes the reference count of the returned container. When the caller has finished using that container, it should call the container's
Release
method.EXCEPTIONS
kODErrCannotCreateContainer
- The specified container type is not valid.
kODErrContainerExists
- A container already exists with the specified container type and container identifier.
SEE ALSO
TheODContainerID
type (page 900).
TheODContainerType
type (page 901).
TheODStorageSystem::AcquireContainer
method (page 658).
TheODContainer
class (page 98).
"Creating a New Document" on page 291 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help